From d271b135bbe92036ff8d63113005c9bc5edfccf5 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 15 Sep 2017 13:20:16 +0200 Subject: [PATCH] gdk/wayland: Drop emission of emulated scroll events A wl_pointer.frame can now only result on one scroll event being emitted. --- gdk/wayland/gdkdevice-wayland.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index 1bc142a20e..61a4d50f06 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -1387,10 +1387,9 @@ flush_scroll_event (GdkWaylandSeat *seat, pointer_frame->discrete_x = 0; pointer_frame->discrete_y = 0; } - - if (pointer_frame->is_scroll_stop || - pointer_frame->delta_x != 0 || - pointer_frame->delta_y != 0) + else if (pointer_frame->is_scroll_stop || + pointer_frame->delta_x != 0 || + pointer_frame->delta_y != 0) { /* Axes can stop independently, if we stop on one axis but have a * delta on the other, we don't count it as a stop event. @@ -1404,11 +1403,13 @@ flush_scroll_event (GdkWaylandSeat *seat, pointer_frame->delta_x, pointer_frame->delta_y, is_stop); - - pointer_frame->delta_x = 0; - pointer_frame->delta_y = 0; - pointer_frame->is_scroll_stop = FALSE; } + + pointer_frame->discrete_x = 0; + pointer_frame->discrete_y = 0; + pointer_frame->delta_x = 0; + pointer_frame->delta_y = 0; + pointer_frame->is_scroll_stop = FALSE; } static void -- 2.30.2